# https://blog.csdn.net/qq_33952811/article/details/108762492?spm=1001.2014.3001.5502
from config import *

'''plot'''
def get_plot_show(x,y,
                  label_name = r"$ w =\frac{1}{500} (\lambda +1)^d$",
                  title = r'鱼的生长曲线图',
                  xlabel = r'天数/day',
                  ylabel = r'重量/kg',
                  size = 15,):
    fig =  plt.figure()
    ax1 = fig.add_subplot(1,1,1)
    '''下面写ax1的相关信息'''
    if label_name is not None:
        plt.plot(x,y,#数据
                 marker='',#标记
                 c='g',#颜色
                 label = label_name#标签名字
                 )

        plt.legend(fontsize = size)  # 标签显示尺寸变14
    else:
        plt.plot(x,y,#数据
                 marker='',#标记
                 c='g',#颜色
                 )
    plt.xlabel(xlabel,size=size)                      #坐标
    plt.ylabel(ylabel,size=size)
    plt.title(title,size=size)
    # plt.xlim(0,100)                          #范围
    # plt.ylim(0,200)
    # my_x_ticks = np.arange(-20, 20, 2)
    # plt.xticks(my_x_ticks)                  #刻度
    # plt.grid()                              #网格
    # plt.axhline(y=0, color="black", linestyle="--")     #画一条渐近线
    # plt.axhline(y=0.5, color="black", linestyle=":")
    # plt.axhline(y=1.0, color="black", linestyle="--")

    # plt.annotate(s="0.2kg需要240天", xy=(240, 0.2), xytext=(100,0.5),arrowprops={"arrowstyle": "->"},size=size)
    # plt.annotate(s="0.75kg需要308天", xy=(308, 0.75), xytext=(150,0.9),arrowprops={"arrowstyle": "->"},size=size)
    # plt.annotate(s="1.5kg需要345天", xy=(345, 1.5), xytext=(200,1.55),arrowprops={"arrowstyle": "->"},size=size)
    # plt.annotate(s="2kg需要360天", xy=(360, 2), xytext=(240,2),arrowprops={"arrowstyle": "->"},size = size)
    # plt.scatter(x=240,y=0.2,color='r')
    # plt.scatter(x=308,y=0.75,color='r')
    # plt.scatter(x=345,y=1.5,color='r')
    # plt.scatter(x=360,y=2,color='r')


    # plt.annotate(s="第360天值为9987", xy=(360, 9987), xytext=(460,6000),arrowprops={"arrowstyle": "->"},size=size)
    # plt.scatter(x=360,y=9987,color='r')
    # plt.annotate(s="第k天值为9997", xy=(735, 9997), xytext=(900,8000),arrowprops={"arrowstyle": "->"},size=size)
    # plt.scatter(x=735,y=9997,color='r')

    plt.show()
'''数据准备'''

# x = np.linspace(-10, 10, 100)       #让间隔变多，使得图像更加平滑
# y = 1 / (1 + np.exp(-x))
# get_plot_show(x,y)

